package com.kim.order.feign;

import com.kim.order.feign.callback.ProductFeignClientCallBack;
import com.kim.order.pojo.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

//指定需要调用的微服务名称
@FeignClient(name="SERVICE-PRODUCT",fallback = ProductFeignClientCallBack.class)
public interface ProductFeignClient {

    //调用请求路线
    @RequestMapping(value = "/product/{id}",method = RequestMethod.GET)
    public Product findById(@PathVariable("id") Integer id);
}
